/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.mapperv3.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.taobao.ibatiside.model.mapperv3.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class Mapperv3FactoryImpl extends EFactoryImpl implements Mapperv3Factory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Mapperv3Factory init() {
		try {
			Mapperv3Factory theMapperv3Factory = (Mapperv3Factory)EPackage.Registry.INSTANCE.getEFactory("platform:/resource/org.taobao.ibatiside.model/model/map3x.xsd"); 
			if (theMapperv3Factory != null) {
				return theMapperv3Factory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new Mapperv3FactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mapperv3FactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case Mapperv3Package.ABSTRACT_ARG: return createAbstractArg();
			case Mapperv3Package.ABSTRACT_ID_OR_RESULT: return createAbstractIdOrResult();
			case Mapperv3Package.ARG: return createArg();
			case Mapperv3Package.ASSOCIATION: return createAssociation();
			case Mapperv3Package.CACHE: return createCache();
			case Mapperv3Package.CACHE_REF: return createCacheRef();
			case Mapperv3Package.CASE: return createCase();
			case Mapperv3Package.CHOOSE: return createChoose();
			case Mapperv3Package.COLLECTION: return createCollection();
			case Mapperv3Package.CONSTRUCTOR: return createConstructor();
			case Mapperv3Package.DELETE: return createDelete();
			case Mapperv3Package.DISCRIMINATOR: return createDiscriminator();
			case Mapperv3Package.DOCUMENT_ROOT: return createDocumentRoot();
			case Mapperv3Package.FOREACH: return createForeach();
			case Mapperv3Package.ID: return createId();
			case Mapperv3Package.ID_ARG: return createIdArg();
			case Mapperv3Package.IF: return createIf();
			case Mapperv3Package.INCLUDE: return createInclude();
			case Mapperv3Package.INSERT: return createInsert();
			case Mapperv3Package.MAPPER: return createMapper();
			case Mapperv3Package.OTHERWISE: return createOtherwise();
			case Mapperv3Package.PARAMETER: return createParameter();
			case Mapperv3Package.PARAMETER_MAP: return createParameterMap();
			case Mapperv3Package.PROPERTY: return createProperty();
			case Mapperv3Package.RESULT: return createResult();
			case Mapperv3Package.RESULT_MAP: return createResultMap();
			case Mapperv3Package.SELECT: return createSelect();
			case Mapperv3Package.SELECT_KEY: return createSelectKey();
			case Mapperv3Package.SET: return createSet();
			case Mapperv3Package.SQL: return createSql();
			case Mapperv3Package.TRIM: return createTrim();
			case Mapperv3Package.TYPE_ALIAS: return createTypeAlias();
			case Mapperv3Package.UPDATE: return createUpdate();
			case Mapperv3Package.WHEN: return createWhen();
			case Mapperv3Package.WHERE: return createWhere();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case Mapperv3Package.CALL_STMT_TYPE:
				return createCallStmtTypeFromString(eDataType, initialValue);
			case Mapperv3Package.MODE_TYPE:
				return createModeTypeFromString(eDataType, initialValue);
			case Mapperv3Package.ORDER_TYPE:
				return createOrderTypeFromString(eDataType, initialValue);
			case Mapperv3Package.RESULT_SET_TYPE_TYPE:
				return createResultSetTypeTypeFromString(eDataType, initialValue);
			case Mapperv3Package.CALL_STMT_TYPE_OBJECT:
				return createCallStmtTypeObjectFromString(eDataType, initialValue);
			case Mapperv3Package.MODE_TYPE_OBJECT:
				return createModeTypeObjectFromString(eDataType, initialValue);
			case Mapperv3Package.ORDER_TYPE_OBJECT:
				return createOrderTypeObjectFromString(eDataType, initialValue);
			case Mapperv3Package.RESULT_SET_TYPE_TYPE_OBJECT:
				return createResultSetTypeTypeObjectFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case Mapperv3Package.CALL_STMT_TYPE:
				return convertCallStmtTypeToString(eDataType, instanceValue);
			case Mapperv3Package.MODE_TYPE:
				return convertModeTypeToString(eDataType, instanceValue);
			case Mapperv3Package.ORDER_TYPE:
				return convertOrderTypeToString(eDataType, instanceValue);
			case Mapperv3Package.RESULT_SET_TYPE_TYPE:
				return convertResultSetTypeTypeToString(eDataType, instanceValue);
			case Mapperv3Package.CALL_STMT_TYPE_OBJECT:
				return convertCallStmtTypeObjectToString(eDataType, instanceValue);
			case Mapperv3Package.MODE_TYPE_OBJECT:
				return convertModeTypeObjectToString(eDataType, instanceValue);
			case Mapperv3Package.ORDER_TYPE_OBJECT:
				return convertOrderTypeObjectToString(eDataType, instanceValue);
			case Mapperv3Package.RESULT_SET_TYPE_TYPE_OBJECT:
				return convertResultSetTypeTypeObjectToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbstractArg createAbstractArg() {
		AbstractArgImpl abstractArg = new AbstractArgImpl();
		return abstractArg;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbstractIdOrResult createAbstractIdOrResult() {
		AbstractIdOrResultImpl abstractIdOrResult = new AbstractIdOrResultImpl();
		return abstractIdOrResult;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Arg createArg() {
		ArgImpl arg = new ArgImpl();
		return arg;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Association createAssociation() {
		AssociationImpl association = new AssociationImpl();
		return association;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Cache createCache() {
		CacheImpl cache = new CacheImpl();
		return cache;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CacheRef createCacheRef() {
		CacheRefImpl cacheRef = new CacheRefImpl();
		return cacheRef;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Case createCase() {
		CaseImpl case_ = new CaseImpl();
		return case_;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Choose createChoose() {
		ChooseImpl choose = new ChooseImpl();
		return choose;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Collection createCollection() {
		CollectionImpl collection = new CollectionImpl();
		return collection;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Constructor createConstructor() {
		ConstructorImpl constructor = new ConstructorImpl();
		return constructor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Delete createDelete() {
		DeleteImpl delete = new DeleteImpl();
		return delete;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Discriminator createDiscriminator() {
		DiscriminatorImpl discriminator = new DiscriminatorImpl();
		return discriminator;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DocumentRoot createDocumentRoot() {
		DocumentRootImpl documentRoot = new DocumentRootImpl();
		return documentRoot;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Foreach createForeach() {
		ForeachImpl foreach = new ForeachImpl();
		return foreach;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Id createId() {
		IdImpl id = new IdImpl();
		return id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IdArg createIdArg() {
		IdArgImpl idArg = new IdArgImpl();
		return idArg;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public If createIf() {
		IfImpl if_ = new IfImpl();
		return if_;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Include createInclude() {
		IncludeImpl include = new IncludeImpl();
		return include;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Insert createInsert() {
		InsertImpl insert = new InsertImpl();
		return insert;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mapper createMapper() {
		MapperImpl mapper = new MapperImpl();
		return mapper;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Otherwise createOtherwise() {
		OtherwiseImpl otherwise = new OtherwiseImpl();
		return otherwise;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Parameter createParameter() {
		ParameterImpl parameter = new ParameterImpl();
		return parameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ParameterMap createParameterMap() {
		ParameterMapImpl parameterMap = new ParameterMapImpl();
		return parameterMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Property createProperty() {
		PropertyImpl property = new PropertyImpl();
		return property;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Result createResult() {
		ResultImpl result = new ResultImpl();
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResultMap createResultMap() {
		ResultMapImpl resultMap = new ResultMapImpl();
		return resultMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Select createSelect() {
		SelectImpl select = new SelectImpl();
		return select;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SelectKey createSelectKey() {
		SelectKeyImpl selectKey = new SelectKeyImpl();
		return selectKey;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Set createSet() {
		SetImpl set = new SetImpl();
		return set;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Sql createSql() {
		SqlImpl sql = new SqlImpl();
		return sql;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Trim createTrim() {
		TrimImpl trim = new TrimImpl();
		return trim;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TypeAlias createTypeAlias() {
		TypeAliasImpl typeAlias = new TypeAliasImpl();
		return typeAlias;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Update createUpdate() {
		UpdateImpl update = new UpdateImpl();
		return update;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public When createWhen() {
		WhenImpl when = new WhenImpl();
		return when;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Where createWhere() {
		WhereImpl where = new WhereImpl();
		return where;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CallStmtType createCallStmtTypeFromString(EDataType eDataType, String initialValue) {
		CallStmtType result = CallStmtType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertCallStmtTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ModeType createModeTypeFromString(EDataType eDataType, String initialValue) {
		ModeType result = ModeType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertModeTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OrderType createOrderTypeFromString(EDataType eDataType, String initialValue) {
		OrderType result = OrderType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertOrderTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResultSetTypeType createResultSetTypeTypeFromString(EDataType eDataType, String initialValue) {
		ResultSetTypeType result = ResultSetTypeType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertResultSetTypeTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CallStmtType createCallStmtTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createCallStmtTypeFromString(Mapperv3Package.Literals.CALL_STMT_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertCallStmtTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertCallStmtTypeToString(Mapperv3Package.Literals.CALL_STMT_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ModeType createModeTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createModeTypeFromString(Mapperv3Package.Literals.MODE_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertModeTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertModeTypeToString(Mapperv3Package.Literals.MODE_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OrderType createOrderTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createOrderTypeFromString(Mapperv3Package.Literals.ORDER_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertOrderTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertOrderTypeToString(Mapperv3Package.Literals.ORDER_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResultSetTypeType createResultSetTypeTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createResultSetTypeTypeFromString(Mapperv3Package.Literals.RESULT_SET_TYPE_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertResultSetTypeTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertResultSetTypeTypeToString(Mapperv3Package.Literals.RESULT_SET_TYPE_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mapperv3Package getMapperv3Package() {
		return (Mapperv3Package)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static Mapperv3Package getPackage() {
		return Mapperv3Package.eINSTANCE;
	}

} //Mapperv3FactoryImpl
